<?php

/**
 * universidad actions.
 *
 * @package    auip
 * @subpackage universidad
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class reportesActions extends sfActions
{
  public function executeReporteUniversidad(sfWebRequest $request)
  {
    $this->universidads = Doctrine_Core::getTable('Universidad')->createQuery('a')->execute();
    $this->setLayout(false);
    $this->getResponse()->setContentType('application/msexcel');
    $this->setTemplate('reporteUniversidad');
  }
  
  public function executeIndex(sfWebRequest $request)
  {
    $this->universidads = Doctrine_Core::getTable('Universidad')->createQuery('a')->execute();
  
  }

  public function executeShow(sfWebRequest $request)
  {
    $this->universidad = Doctrine_Core::getTable('Universidad')->find(array($request->getParameter('id')));
    $this->forward404Unless($this->universidad);
  }


  protected function processForm(sfWebRequest $request, sfForm $form)
  {
    $form->bind($request->getParameter($form->getName()), $request->getFiles($form->getName()));
    if ($form->isValid())
    {
      $universidad = $form->save();

      //$this->redirect('universidad/edit?id='.$universidad->getId());
      $this->redirect('becas/entidad');            
    }
  }
}
